<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="utf-8">
  

  
  <title>springboot2 属性绑定 | Hexo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="简单类型在Spring Boot 2.0中对配置属性加载的时候会除了像1.x版本时候那样移除特殊字符外，还会将配置均以全小写的方式进行匹配和加载。所以，下面的4种配置方式都是等价的：">
<meta name="keywords" content="springboot">
<meta property="og:type" content="article">
<meta property="og:title" content="springboot2 属性绑定">
<meta property="og:url" content="http://yoursite.com/2018/10/12/2018-06-17-SpringBoot2.0属性绑定/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="简单类型在Spring Boot 2.0中对配置属性加载的时候会除了像1.x版本时候那样移除特殊字符外，还会将配置均以全小写的方式进行匹配和加载。所以，下面的4种配置方式都是等价的：">
<meta property="og:locale" content="default">
<meta property="og:updated_time" content="2018-11-01T14:24:04.957Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="springboot2 属性绑定">
<meta name="twitter:description" content="简单类型在Spring Boot 2.0中对配置属性加载的时候会除了像1.x版本时候那样移除特殊字符外，还会将配置均以全小写的方式进行匹配和加载。所以，下面的4种配置方式都是等价的：">
  
    <link rel="alternate" href="/org/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/org/css/style.css">
</head>
</html>
<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/org/" id="logo">Hexo</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/org/">Home</a>
        
          <a class="main-nav-link" href="/org/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/org/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-2018-06-17-SpringBoot2.0属性绑定" class="article article-type-post" itemscope="" itemprop="blogPost">
  <div class="article-meta">
    <a href="/org/2018/10/12/2018-06-17-SpringBoot2.0属性绑定/" class="article-date">
  <time datetime="2018-10-12T09:03:30.000Z" itemprop="datePublished">2018-10-12</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      springboot2 属性绑定
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h3 id="简单类型"><a href="#简单类型" class="headerlink" title="简单类型"></a>简单类型</h3><p>在Spring Boot 2.0中对配置属性加载的时候会除了像1.x版本时候那样<strong>移除特殊字符</strong>外，还会将配置均以<strong>全小写</strong>的方式进行匹配和加载。所以，下面的4种配置方式都是等价的：</p>
<a id="more"></a>
<ul>
<li>properties格式：</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">spring.jpa.databaseplatform=mysql</span><br><span class="line">spring.jpa.database-platform=mysql</span><br><span class="line">spring.jpa.databasePlatform=mysql</span><br><span class="line">spring.JPA.database_platform=mysql</span><br></pre></td></tr></table></figure>
<ul>
<li>yaml格式：</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">spring:</span><br><span class="line">  jpa:</span><br><span class="line">    databaseplatform: mysql</span><br><span class="line">    database-platform: mysql</span><br><span class="line">    databasePlatform: mysql</span><br><span class="line">    database_platform: mysql</span><br></pre></td></tr></table></figure>
<p><strong>Tips：推荐使用全小写配合-分隔符的方式来配置，比如：spring.jpa.database-platform=mysql</strong></p>
<h3 id="List类型"><a href="#List类型" class="headerlink" title="List类型"></a>List类型</h3><p>在properties文件中使用<code>[]</code>来定位列表类型，比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">spring.my-example.url[0]=http://example.com</span><br><span class="line">spring.my-example.url[1]=http://spring.io</span><br></pre></td></tr></table></figure>
<p>也支持使用<strong>逗号</strong>分割的配置方式，上面与下面的配置是等价的：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">spring.my-example.url=http://example.com,http://spring.io</span><br></pre></td></tr></table></figure>
<p>而在yaml文件中使用可以使用如下配置：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">spring:</span><br><span class="line">  my-example:</span><br><span class="line">    url:</span><br><span class="line">      - http://example.com</span><br><span class="line">      - http://spring.io</span><br></pre></td></tr></table></figure>
<p>也支持<strong>逗号</strong>分割的方式：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">spring:</span><br><span class="line">  my-example:</span><br><span class="line">    url: http://example.com, http://spring.io</span><br></pre></td></tr></table></figure>
<p><strong>注意：在Spring Boot 2.0中对于List类型的配置必须是连续的，不然会抛出UnboundConfigurationPropertiesException异常，所以如下配置是不允许的：</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">foo[0]=a</span><br><span class="line">foo[2]=b</span><br></pre></td></tr></table></figure>
<p><strong>在Spring Boot 1.x中上述配置是可以的，foo[1]由于没有配置，它的值会是null</strong></p>
<h3 id="Map类型"><a href="#Map类型" class="headerlink" title="Map类型"></a>Map类型</h3><p>Map类型在properties和yaml中的标准配置方式如下：</p>
<ul>
<li>properties格式：</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">spring.my-example.foo=bar</span><br><span class="line">spring.my-example.hello=world</span><br></pre></td></tr></table></figure>
<ul>
<li>yaml格式：</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">spring:</span><br><span class="line">  my-example:</span><br><span class="line">    foo: bar</span><br><span class="line">    hello: world</span><br></pre></td></tr></table></figure>
<p><strong>注意：如果Map类型的key包含非字母数字和-的字符，需要用[]括起来，比如：</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">spring:</span><br><span class="line">  my-example:</span><br><span class="line">    &apos;[foo.baz]&apos;: bar</span><br></pre></td></tr></table></figure>
<h2 id="环境属性绑定"><a href="#环境属性绑定" class="headerlink" title="环境属性绑定"></a>环境属性绑定</h2><p><strong>简单类型</strong></p>
<p>在环境变量中通过小写转换与<code>.</code>替换<code>_</code>来映射配置文件中的内容，比如：环境变量<code>SPRING_JPA_DATABASEPLATFORM=mysql</code>的配置会产生与在配置文件中设置<code>spring.jpa.databaseplatform=mysql</code>一样的效果。</p>
<p><strong>List类型</strong></p>
<p>由于环境变量中无法使用<code>[</code>和<code>]</code>符号，所以使用<code>_</code>来替代。任何由下划线包围的数字都会被认为是<code>[]</code>的数组形式。比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">MY_FOO_1_ = my.foo[1]</span><br><span class="line">MY_FOO_1_BAR = my.foo[1].bar</span><br><span class="line">MY_FOO_1_2_ = my.foo[1][2]</span><br></pre></td></tr></table></figure>
<p>另外，最后环境变量最后是以数字和下划线结尾的话，最后的下划线可以省略，比如上面例子中的第一条和第三条等价于下面的配置：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">MY_FOO_1 = my.foo[1]</span><br><span class="line">MY_FOO_1_2 = my.foo[1][2]</span><br></pre></td></tr></table></figure>
<h2 id="系统属性绑定"><a href="#系统属性绑定" class="headerlink" title="系统属性绑定"></a>系统属性绑定</h2><p><strong>简单类型</strong></p>
<p>系统属性与文件配置中的类似，都以移除特殊字符并转化小写后实现绑定，比如下面的命令行参数都会实现配置<code>spring.jpa.databaseplatform=mysql</code>的效果：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">-Dspring.jpa.database-platform=mysql</span><br><span class="line">-Dspring.jpa.databasePlatform=mysql</span><br><span class="line">-Dspring.JPA.database_platform=mysql</span><br></pre></td></tr></table></figure>
<p><strong>List类型</strong></p>
<p>系统属性的绑定也与文件属性的绑定类似，通过<code>[]</code>来标示，比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">-D&quot;spring.my-example.url[0]=http://example.com&quot;</span><br><span class="line">-D&quot;spring.my-example.url[1]=http://spring.io&quot;</span><br></pre></td></tr></table></figure>
<p>同样的，他也支持逗号分割的方式，比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">-Dspring.my-example.url=http://example.com,http://spring.io</span><br></pre></td></tr></table></figure>
<h2 id="属性的读取"><a href="#属性的读取" class="headerlink" title="属性的读取"></a>属性的读取</h2><p>上文介绍了Spring Boot 2.0中对属性绑定的内容，可以看到对于一个属性我们可以有多种不同的表达，但是如果我们要在Spring应用程序的environment中读取属性的时候，每个属性的唯一名称符合如下规则：</p>
<ul>
<li>通过<code>.</code>分离各个元素</li>
<li>最后一个<code>.</code>将前缀与属性名称分开</li>
<li>必须是字母（a-z）和数字(0-9)</li>
<li>必须是小写字母</li>
<li>用连字符<code>-</code>来分隔单词</li>
<li>唯一允许的其他字符是<code>[</code>和<code>]</code>，用于List的索引</li>
<li>不能以数字开头</li>
</ul>
<p>所以，如果我们要读取配置文件中<code>spring.jpa.database-platform</code>的配置，可以这样写：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">this.environment.containsProperty(&quot;spring.jpa.database-platform&quot;)</span><br></pre></td></tr></table></figure>
<p>而下面的方式是无法获取到<code>spring.jpa.database-platform</code>配置内容的：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">this.environment.containsProperty(&quot;spring.jpa.databasePlatform&quot;)</span><br></pre></td></tr></table></figure>
<p><strong>注意：使用@Value获取配置内容的时候也需要这样的特点</strong></p>
<h2 id="全新的绑定API"><a href="#全新的绑定API" class="headerlink" title="全新的绑定API"></a>全新的绑定API</h2><p>在Spring Boot 2.0中增加了新的绑定API来帮助我们更容易的获取配置信息。下面举个例子来帮助大家更容易的理解：</p>
<p><strong>例子一：简单类型</strong></p>
<p>假设在propertes配置中有这样一个配置：<code>com.didispace.foo=bar</code></p>
<p>我们为它创建对应的配置类：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">@Data</span><br><span class="line">@ConfigurationProperties(prefix = &quot;com.didispace&quot;)</span><br><span class="line">public class FooProperties &#123;</span><br><span class="line"></span><br><span class="line">    private String foo;</span><br><span class="line"></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>接下来，通过最新的<code>Binder</code>就可以这样来拿配置信息了：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">@SpringBootApplication</span><br><span class="line">public class Application &#123;</span><br><span class="line"></span><br><span class="line">    public static void main(String[] args) &#123;</span><br><span class="line">        ApplicationContext context = SpringApplication.run(Application.class, args);</span><br><span class="line"></span><br><span class="line">        Binder binder = Binder.get(context.getEnvironment());</span><br><span class="line"></span><br><span class="line">        // 绑定简单配置</span><br><span class="line">        FooProperties foo = binder.bind(&quot;com.didispace&quot;, Bindable.of(FooProperties.class)).get();</span><br><span class="line">        System.out.println(foo.getFoo());</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p><strong>例子二：List类型</strong></p>
<p>如果配置内容是List类型呢？比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">com.didispace.post[0]=Why Spring Boot</span><br><span class="line">com.didispace.post[1]=Why Spring Cloud</span><br><span class="line"></span><br><span class="line">com.didispace.posts[0].title=Why Spring Boot</span><br><span class="line">com.didispace.posts[0].content=It is perfect!</span><br><span class="line">com.didispace.posts[1].title=Why Spring Cloud</span><br><span class="line">com.didispace.posts[1].content=It is perfect too!</span><br></pre></td></tr></table></figure>
<p>要获取这些配置依然很简单，可以这样实现：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">ApplicationContext context = SpringApplication.run(Application.class, args);</span><br><span class="line"></span><br><span class="line">Binder binder = Binder.get(context.getEnvironment());</span><br><span class="line"></span><br><span class="line">// 绑定List配置</span><br><span class="line">List&lt;String&gt; post = binder.bind(&quot;com.didispace.post&quot;, Bindable.listOf(String.class)).get();</span><br><span class="line">System.out.println(post);</span><br><span class="line"></span><br><span class="line">List&lt;PostInfo&gt; posts = binder.bind(&quot;com.didispace.posts&quot;, Bindable.listOf(PostInfo.class)).get();</span><br><span class="line">System.out.println(posts);</span><br></pre></td></tr></table></figure>
<h2 id="代码示例"><a href="#代码示例" class="headerlink" title="代码示例"></a>代码示例</h2><p><a href="https://gitee.com/anweb/SpringBoot-Learning" target="_blank" rel="noopener">完整代码下载</a></p>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2018/10/12/2018-06-17-SpringBoot2.0属性绑定/" data-id="cjoztxu5q00221wijey7lnhww" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/org/tags/springboot/">springboot</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/org/2018/10/12/2018-06-15-Jenkins持续集成入门篇/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          Jenkins继续集成入门
        
      </div>
    </a>
  
  
    <a href="/org/2018/10/12/2018-06-17-SpringBoot web开发-Thymeleaf模板引擎/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">SpringBoot web开发-Thymeleaf模板引擎</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/org/tags/SVN/">SVN</a></li><li class="tag-list-item"><a class="tag-list-link" href="/org/tags/Spring-secrity/">Spring-secrity</a></li><li class="tag-list-item"><a class="tag-list-link" href="/org/tags/hexo/">hexo</a></li><li class="tag-list-item"><a class="tag-list-link" href="/org/tags/hibenrate/">hibenrate</a></li><li class="tag-list-item"><a class="tag-list-link" href="/org/tags/jekyll/">jekyll</a></li><li class="tag-list-item"><a class="tag-list-link" href="/org/tags/jenkins/">jenkins</a></li><li class="tag-list-item"><a class="tag-list-link" href="/org/tags/redis/">redis</a></li><li class="tag-list-item"><a class="tag-list-link" href="/org/tags/shiro/">shiro</a></li><li class="tag-list-item"><a class="tag-list-link" href="/org/tags/spingMVC/">spingMVC</a></li><li class="tag-list-item"><a class="tag-list-link" href="/org/tags/spring-cloud/">spring cloud</a></li><li class="tag-list-item"><a class="tag-list-link" href="/org/tags/spring-cloud/">spring-cloud</a></li><li class="tag-list-item"><a class="tag-list-link" href="/org/tags/spring-secrity/">spring-secrity</a></li><li class="tag-list-item"><a class="tag-list-link" href="/org/tags/springMVC/">springMVC</a></li><li class="tag-list-item"><a class="tag-list-link" href="/org/tags/springboot/">springboot</a></li><li class="tag-list-item"><a class="tag-list-link" href="/org/tags/生活/">生活</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/org/tags/SVN/" style="font-size: 12px;">SVN</a> <a href="/org/tags/Spring-secrity/" style="font-size: 10px;">Spring-secrity</a> <a href="/org/tags/hexo/" style="font-size: 10px;">hexo</a> <a href="/org/tags/hibenrate/" style="font-size: 10px;">hibenrate</a> <a href="/org/tags/jekyll/" style="font-size: 10px;">jekyll</a> <a href="/org/tags/jenkins/" style="font-size: 10px;">jenkins</a> <a href="/org/tags/redis/" style="font-size: 16px;">redis</a> <a href="/org/tags/shiro/" style="font-size: 18px;">shiro</a> <a href="/org/tags/spingMVC/" style="font-size: 10px;">spingMVC</a> <a href="/org/tags/spring-cloud/" style="font-size: 10px;">spring cloud</a> <a href="/org/tags/spring-cloud/" style="font-size: 10px;">spring-cloud</a> <a href="/org/tags/spring-secrity/" style="font-size: 12px;">spring-secrity</a> <a href="/org/tags/springMVC/" style="font-size: 14px;">springMVC</a> <a href="/org/tags/springboot/" style="font-size: 20px;">springboot</a> <a href="/org/tags/生活/" style="font-size: 10px;">生活</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/org/archives/2018/11/">November 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/org/archives/2018/10/">October 2018</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/org/2018/11/27/redis07-zookeeper-kafka集群部署以及如何使用简单介绍/">redis07-zookeeper+kafka集群部署以及如何使用简单介绍</a>
          </li>
        
          <li>
            <a href="/org/2018/11/13/redis06-cluster实现高可用性/">redis06-cluster实现高可用性</a>
          </li>
        
          <li>
            <a href="/org/2018/11/12/redis05-在项目中搭建读写分-高可用-多master的redis-cluster集群/">redis05-在项目中搭建读写分+高可用+多master的redis cluster集群</a>
          </li>
        
          <li>
            <a href="/org/2018/11/05/在项目中用经典的三节点方式部署哨兵集群-笔记/">在项目中用经典的三节点方式部署哨兵集群-笔记</a>
          </li>
        
          <li>
            <a href="/org/2018/11/05/redis哨兵的多个核心底层原理-笔记/">redis哨兵的多个核心底层原理-笔记</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2018 John Doe<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/org/" class="mobile-nav-link">Home</a>
  
    <a href="/org/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//code.jquery.com/jquery-2.0.3.min.js"></script>


  <link rel="stylesheet" href="/org/fancybox/jquery.fancybox.css">
  <script src="/org/fancybox/jquery.fancybox.pack.js"></script>


<script src="/org/js/script.js"></script>



  </div>
</body>
</html>